package com.turing.draw.client.reviewer;

import com.turing.common.response.ResponseVO;
import lombok.Data;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "data", path = "review", primary = true)
public interface ReviewTaskInnerService {

    @Data
    class ReviewRequestVO {

        private String filePath;

        private String taskSn;

        private String requestSn;
    }

    /*
     * 对外-请求数据审核接口
     * */
    @PostMapping("requireReview")
    ResponseVO<String> requireReview(@RequestBody ReviewRequestVO requestVO);

    @PostMapping("writeReviewedResult")
    void writeReviewedResult(@RequestParam("taskSn") String taskSn, @RequestParam("uploadTime") String uploadTime);

    /**
     * 从主场景复制数据
     * @param taskSn    主场景任务id
     * @param newTaskSn 子场景任务id
     * @return com.turing.common.response.ResponseVO<java.lang.Boolean>
     * @author lcy
     * @date 2021/6/16 10:42
     **/
    @PostMapping("copyTaskContent")
    ResponseVO<Boolean> copyTaskContent(@RequestParam String taskSn, @RequestParam String newTaskSn);

    @PostMapping("runScriptsTask")
    ResponseVO<String> runScriptsTask( @RequestParam("parentTaskSn") String taskSn );

}
